public class walkBlock {
    public static boolean isValid(char[] walk) {
      // Insert brilliant code here
      if(walk.length > 10)return false;
      int sum = 0;
      for(int i = 0;i<=walk.length;i++){
        switch(walk[i]){
            case('n'):sum += 1;break;
            case('w'):sum += 300;break;
            case('s'):sum -= 1;break;
            case('e'):sum -= 300;break;
        }
        
      }
     if(sum == 0)
       return true;
      else
        return false;
    }
  }